#include "Normal_distribution.h"
#include <iostream>
#include <QDebug>
#include <random>

Normal_distribution::Normal_distribution()
{

}

void Normal_distribution::get_mean_value()
{

    double Normal_distribution_mean = Distribution_parameter_1;
    qDebug() << "normal_mean is" << Normal_distribution_mean;

}

void Normal_distribution::get_deviation()
{
    double Normal_distribution_deviation = Distribution_parameter_2;
    qDebug() << "normal_deviation is" << Normal_distribution_deviation;

}

void Normal_distribution::get_random_number()
{

    std::default_random_engine generator;                                 //分布生成器
    std::normal_distribution<double> distribution(Distribution_parameter_1, Distribution_parameter_2);  //生成服从**的正态分布

    double SN = Sample_Number;
    double *a;
    a = new double[SN];
    for (int i = 0; i<SN; ++i)                //生成的正态分布随机数放入a中
    {
        a[i] = distribution(generator);
    }

    std::cout <<"Normal distribution " <<SN<<" samples is:"<<std::endl;
    for ( int j = 0; j < SN; j++ )             //打印a
        std::cout << a[ j ] <<" ";
//    return 0;

}
